import Vue from 'vue'
import App from './App'
import store from "./store";
import {setToast,setModal,change} from "./utils";
import {changeUrl,getObjectKeys, parseTime,changeAvatar} from "./utils/association"
// import mpvueToastRegistry from 'mptoast'
// mpvueToastRegistry(Vue)

Vue.prototype.$store = store
Vue.prototype.setToast = setToast
Vue.prototype.changeAvatar = changeAvatar
Vue.prototype.parseTime = parseTime
Vue.prototype.setModal = setModal
Vue.prototype.change = change
Vue.prototype.changeUrl = changeUrl
Vue.prototype.getObjectKeys = getObjectKeys
Vue.config.productionTip = false
App.mpType = 'app'




/*import {getToken} from "./utils/auth";

if (getToken()) {
  if (this.$store.getters.roles.length === 0) {
    // 判断当前用户是否已拉取完user_info信息
    store.dispatch('GetInfo').then(res => {
    }).catch(err => {
      this.$store.dispatch('LogOut').then(() => {
        this.setToast({ title: err })
        wx.redirectTo({
          url: '/pages/subpage/login/main'
        })
      })
    })
  }
}*/

const app = new Vue({
  ...App,
  store
})
app.$mount()

